﻿using System;

using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Controls.Beta
{
    /// <summary>
    /// Specifies what a control must implement that maintains a <see cref="VirtualItemCollection"/>.
    /// </summary>
    public interface IItemControl
    {
        /// <summary>
        /// Notifies the control that one ore more items have changed.
        /// </summary>
        void ItemsInvalidated();

        /// <summary>
        /// Gets an instance of <see cref="ItemBase"/>.
        /// </summary>
        ItemBase GetVirtualItem(int index);


        /// <summary>
        /// Occurs after an item was removed from the collection.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <param name="item">Item that was removed.</param>
        void OnItemRemoved(int index, ItemBase item);

        /// <summary>
        /// Occurs after an item was inserted into the collection.
        /// </summary>
        /// <param name="index">Index of the item.</param>
        /// <param name="item">Item that was inserted.</param>
        void OnItemInserted(int index, ItemBase item);

        /// <summary>
        /// Occurs when the collection was cleared.
        /// </summary>
        void OnClear();

        ListBoxBase ListBox { get; }
    }
}

